package com.css.security.core.config;

import org.springframework.social.security.SocialAuthenticationFilter;
import org.springframework.social.security.SpringSocialConfigurer;

/**
 * CssSpringSocialConfigurer
 *
 * @author hanyx
 * @date 2019/04/15
 */
public class CssSpringSocialConfigurer extends SpringSocialConfigurer {

    private String filterProcessesUrl;

    public CssSpringSocialConfigurer(String filterProcessesUrl) {
        this.filterProcessesUrl = filterProcessesUrl;
    }

    /**
     * 自定义配置过滤器
     *
     * @param object
     * @return SocialAuthenticationFilter
     */
    @Override
    protected <T> T postProcess(T object) {
        SocialAuthenticationFilter socialAuthenticationFilter = (SocialAuthenticationFilter) super.postProcess(object);
        socialAuthenticationFilter.setFilterProcessesUrl(filterProcessesUrl);
        return super.postProcess(object);
    }
}
